package com.mcp.server.model;

import lombok.Data;

/**
 * MCP响应对象
 * @author lizhentao
 */
@Data
public class McpResponse {

    /**
     * 协议版本号
     */
    private String jsonrpc = "2.0";

    /**
     * id
     */
    private Object id;

    /**
     * 成功结果
     */
    private Object result;

    /**
     *  错误信息
     */
    private McpError error;
    
    public static McpResponse success(Object id, Object result) {
        McpResponse response = new McpResponse();
        response.setId(id);
        response.setResult(result);
        return response;
    }
    
    public static McpResponse error(Object id, McpError error) {
        McpResponse response = new McpResponse();
        response.setId(id);
        response.setError(error);
        return response;
    }
}